/**************************************************************************
 * @doc EMV 
 * @module EMV |  
 * Source code for the EMV handling functions.
 *
 * Product         :   SoftPay 2000 (Global Payment Methodology).
 * <nl>Developer   :   SoftPay Development Team (I_SP2000).
 * <nl>Notes       :
 *
 * @head3 EMV Functions |
 * @index | EMV
 * @end
 *
 * Copyright (c) 1996-2000 by VeriFone Inc. All rights reserved.
 * 
 * No part of this software may be used, stored, compiled, reproduced,
 * modified, transcribed, translated, transmitted, or transferred, in any form 
 * or by any means whether electronic, mechanical, magnetic, optical, 
 * or otherwise, without the express prior written permission of VeriFone, Inc.
 *
 * Revision History
 * ------------------------------------------------------------------------
 $Log: /SoftPay/SPK2SIM/Source/EMVSrc/EMVids.h $

1. vipin_k1 12/10/00 changed the cpacids to avaoid clashes with Amex.

********************************************************************************/

////////////////////////////////////////////////////////////////////
//
// D E F I N E S
//

/* Values for Field IDs in batch flexi record */
#define FID_EMV_TAG_82_AIP                        0x6301
#define FID_EMV_TAG_9F36_ATC                    0x6302
#define FID_EMV_AUC                    			    0x6303
#define FID_EMV_TAG_9F27_CID                      0x6304
#define FID_EMV_CVM_LIST                    0x6305
#define FID_EMV_TAG_9F34_CVM_RESULTS                 0x6306
#define FID_EMV_IAC_DEFAULT                 0x6307
#define FID_EMV_IAC_DENIAL                  0x6308
#define FID_EMV_IAC_ONLINE                  0x6309
#define FID_EMV_TAG_9F10_ISSUER_APP_DATA             0x630A
#define FID_EMV_ISSUER_SCRIPT_RESULTS       0x630B
#define FID_EMV_TAG_9F33_TERM_CAPABILITIES           0x630C
#define FID_EMV_TAG_9F35_TERM_TYPE                   0x630D
#define FID_EMV_TAG_95_TVR                         0x630E
#define FID_EMV_TAG_9F26_APP_CRYPTOGRAM              0x630F
#define FID_EMV_TAG_9F37_UNPREDICT_NUMBER            0x6310
#define FID_EMV_TAG_5F2A_CURR_CODE		0x6311
#define FID_EMV_TAG_5F34_PAN_SEQ_NUM		0x6312
#define FID_EMV_TAG_84_DF_NAME			0x6313
#define FID_EMV_TAG_9A_TXN_DATE		0x6314
#define FID_EMV_TAG_9C_TXN_TYPE		0x6315
#define FID_EMV_TAG_9F09_APPLN_VER	0x6316
#define FID_EMV_TAG_9F1A_TERM_CRTY_CODE	0x6317
#define FID_EMV_TAG_9F53_TRAN_CAT_CODE	0x6318
#define FID_EMV_TAG_9F02_AMT_AUTH		0x6319
#define FID_EMV_TAG_9F03_AMT_OTHR		0x631A

//Length of the EMV data
#define FID_EMV_TAG_82_AIP_LEN			0x631B	
#define FID_EMV_TAG_9F36_ATC_LEN                    0x631C
#define FID_EMV_TAG_9F27_CID_LEN                      0x631D
#define FID_EMV_TAG_9F34_CVM_RESULTS_LEN                 0x631E
#define FID_EMV_TAG_9F10_ISSUER_APP_DATA_LEN             0x631F
#define FID_EMV_TAG_9F33_TERM_CAPABILITIES_LEN           0x6320
#define FID_EMV_TAG_9F35_TERM_TYPE_LEN                   0x6321
#define FID_EMV_TAG_95_TVR_LEN                         0x6322
#define FID_EMV_TAG_9F26_APP_CRYPTOGRAM_LEN              0x6323
#define FID_EMV_TAG_9F37_UNPREDICT_NUMBER_LEN            0x6324
#define FID_EMV_TAG_5F2A_CURR_CODE_LEN		0x6325
#define FID_EMV_TAG_5F34_PAN_SEQ_NUM_LEN		0x6326
#define FID_EMV_TAG_84_DF_NAME_LEN			0x6327
#define FID_EMV_TAG_9A_TXN_DATE_LEN		0x6328
#define FID_EMV_TAG_9C_TXN_TYPE_LEN		0x6329
#define FID_EMV_TAG_9F09_APPLN_VER_LEN	0x632A
#define FID_EMV_TAG_9F1A_TERM_CRTY_CODE_LEN	0x632B
#define FID_EMV_TAG_9F53_TRAN_CAT_CODE_LEN	0x632C
#define FID_EMV_TAG_9F02_AMT_AUTH_LEN		0x632D
#define FID_EMV_TAG_9F03_AMT_OTHR_LEN		0x632E


#define FID_EMV_TAG_9F1E_IFD_SER_NUM				0x632F
#define FID_EMV_TAG_9F1E_IFD_SER_NUM_LEN		0x6330
#define FID_EMV_TAG_9F41_TRANS_SEQ_COUNTER		0x6331
#define FID_EMV_TAG_9F41_TRANS_SEQ_COUNTER_LEN	0x6332
#define FID_EMV_ISSUER_SCRIPT_RESULTS_LEN 		0x6333

//KiaSoon 06022006: To put TC for the APP CRYPT on Receipt
#define FID_EMV_TAG_9F26_APP_CRYPTOGRAM_2ND             0x6334 
#define FID_EMV_TAG_95_TVR_2ND                          0x6335
#define FID_EMV_TAG_95_TVR_LEN_2ND                      0x6336
#define FID_EMV_TAG_9F26_APP_CRYPTOGRAM_LEN_2ND         0x6337
//KiaSoon Ended

//LIEM
#define FID_EMV_TAG_4F_AID								0x6338
#define FID_EMV_TAG_91									0x6339
#define FID_EMV_TAG_91_LEN				                0x633A
#define FID_EMV_TAG_95_TVR_REQ                          0x633B
#define FID_EMV_TAG_95_TVR_LEN_REQ                      0x633C
#define FID_EMV_TAG_9F10_ISSUER_APP_DATA_REQ			0x633D
#define FID_EMV_TAG_9F10_ISSUER_APP_DATA_LEN_REQ		0x633E
#define FID_EMV_TAG_9F26_APP_CRYPTOGRAM_REQ             0x633F
#define FID_EMV_TAG_9F26_APP_CRYPTOGRAM_LEN_REQ         0x6340

//edi
#define FID_EMV_TAG_4F_AID_LEN					0x6341
#define FID_EMV_IAC_DEFAULT_LEN                 0x6342
#define FID_EMV_IAC_DENIAL_LEN                  0x6343
#define FID_EMV_IAC_ONLINE_LEN                  0x6344


#define EMV_GET_TERMID			0x0086 //inEMVGetTermID
#define EMV_REFERRAL_PROCESSING		0x0087

#define EMV_LOG_REPORT_OPERATION	0x10B2
#define EMV_PRINT_LOG_REPORT		0x10B3
#define EMV_DEBUG_PRINT_OPERATION	0x10B4
#define EMV_DEBUG_PRINT_REPORT		0x10B5
#define EMV_FORCE_ONLINE_OPERATION	0x10B6
#define EMV_FORCE_ONLINE		0x10B7
#define EMV_CHECK_FORCE_ONLINE		0x10B8
#define EMV_RESET_FORCE_ONLINE_TIME	0x10B9
#define EMV_SET_AUTH_FLOOR_LIMIT	0x10BA
#define EMV_RESET_AUTH_FLOOR_LIMIT	0x10BB
#define EMV_ADD_DATA_TO_BATCH		0x10BC
#define EMV_DISPLAY_SIG_REQD		0x10BD
#define EMV_RESET_FALLBACK_TIME		0x10BE
#define EMV_CHECK_TRANS_ALLWD		0x10BF
#define EMV_CHECK_FALLBACK_TIME		0x10C0
#define EMV_CHECK_FORCEONLINE_TIME	0x10C1
#define EMV_PRINT_RECEIPT_TOP		0x10C2
#define EMV_SET_NONCHIP			0x10C3  //KiaSoon 07022006: For those transaction does not require full EMV flow


#define EMV_GO_ONLINE      -1
#define EMV_OFFLINE_AUTH   -2
#define EMV_DECLINE        -3
#define EMV_VOICE_REFERRAL -4
#define CONNECT_FAILED		-5

#define CARD_REFERRAL	204

//PFR IDs
#define EMV_ANALYSE_COMPLETE			30
#define PFR_BEGIN_EMV_UPDATE_BATCH	31

#define MAX_MENU_ITEMS			3


